import sys, string, os, codecs

if __name__ == "__main__":
    mystr = "thug$83312$"
    
    if mystr.count("$") >= 2 and mystr[len(mystr)-1] == "$":
        print mystr.split("$")[0]